<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>wickr-crypto-c: wickr_stream</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">wickr-crypto-c
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">wickr_stream</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwickr__stream__ctx.html">wickr_stream_ctx</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A context that is used for encrypting or decrypting a sequenced stream of data packets The stream context manages the state of stream operations including key evolution management based on the sequence number of the being encrypted / decrypted. The stream context is assigned a direction, and can only be used for encoding OR decoding of packets, and not both.  <a href="structwickr__stream__ctx.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga0b5c513a3e0958dc7fd4f8455206e32e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__stream__ctx.html">wickr_stream_ctx_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__stream.html#ga0b5c513a3e0958dc7fd4f8455206e32e">wickr_stream_ctx_create</a> (const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a> engine, <a class="el" href="structwickr__stream__key.html">wickr_stream_key_t</a> *stream_key, wickr_stream_direction direction)</td></tr>
<tr class="separator:ga0b5c513a3e0958dc7fd4f8455206e32e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga707b685e35eb437c33f5ec32c6760005"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__stream__ctx.html">wickr_stream_ctx_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__stream.html#ga707b685e35eb437c33f5ec32c6760005">wickr_stream_ctx_copy</a> (const <a class="el" href="structwickr__stream__ctx.html">wickr_stream_ctx_t</a> *ctx)</td></tr>
<tr class="separator:ga707b685e35eb437c33f5ec32c6760005"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga621a3ec801ab996b4fab1fe905c450bd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__stream.html#ga621a3ec801ab996b4fab1fe905c450bd">wickr_stream_ctx_encode</a> (<a class="el" href="structwickr__stream__ctx.html">wickr_stream_ctx_t</a> *ctx, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *data, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *aad, uint64_t seq_num)</td></tr>
<tr class="separator:ga621a3ec801ab996b4fab1fe905c450bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa1eb323694f2c1652b51127b0b89138c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__stream.html#gaa1eb323694f2c1652b51127b0b89138c">wickr_stream_ctx_decode</a> (<a class="el" href="structwickr__stream__ctx.html">wickr_stream_ctx_t</a> *ctx, const <a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a> *data, const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *aad, uint64_t seq_num)</td></tr>
<tr class="separator:gaa1eb323694f2c1652b51127b0b89138c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga05260bfce1f50352cad32e0354c28a1d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__stream.html#ga05260bfce1f50352cad32e0354c28a1d">wickr_stream_ctx_destroy</a> (<a class="el" href="structwickr__stream__ctx.html">wickr_stream_ctx_t</a> **ctx)</td></tr>
<tr class="separator:ga05260bfce1f50352cad32e0354c28a1d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga98121b9f8cdab6596cbd3bb0d99be6e3"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wickr__stream.html#ga98121b9f8cdab6596cbd3bb0d99be6e3">wickr_stream_ctx_ref_up</a> (<a class="el" href="structwickr__stream__ctx.html">wickr_stream_ctx_t</a> *ctx)</td></tr>
<tr class="separator:ga98121b9f8cdab6596cbd3bb0d99be6e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga707b685e35eb437c33f5ec32c6760005"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga707b685e35eb437c33f5ec32c6760005">&#9670;&nbsp;</a></span>wickr_stream_ctx_copy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__stream__ctx.html">wickr_stream_ctx_t</a>* wickr_stream_ctx_copy </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__stream__ctx.html">wickr_stream_ctx_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Copy a stream context</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>the stream context to copy </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated stream context holding a deep copy of properties from 'ctx' </dd></dl>

</div>
</div>
<a id="ga0b5c513a3e0958dc7fd4f8455206e32e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0b5c513a3e0958dc7fd4f8455206e32e">&#9670;&nbsp;</a></span>wickr_stream_ctx_create()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__stream__ctx.html">wickr_stream_ctx_t</a>* wickr_stream_ctx_create </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structwickr__crypto__engine.html">wickr_crypto_engine_t</a>&#160;</td>
          <td class="paramname"><em>engine</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwickr__stream__key.html">wickr_stream_key_t</a> *&#160;</td>
          <td class="paramname"><em>stream_key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">wickr_stream_direction&#160;</td>
          <td class="paramname"><em>direction</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Create a stream context</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">engine</td><td>see <a class="el" href="structwickr__stream__ctx.html" title="A context that is used for encrypting or decrypting a sequenced stream of data packets The stream con...">wickr_stream_ctx</a> documentation </td></tr>
    <tr><td class="paramname">stream_key</td><td>see <a class="el" href="structwickr__stream__ctx.html" title="A context that is used for encrypting or decrypting a sequenced stream of data packets The stream con...">wickr_stream_ctx</a> documentation </td></tr>
    <tr><td class="paramname">direction</td><td>see <a class="el" href="structwickr__stream__ctx.html" title="A context that is used for encrypting or decrypting a sequenced stream of data packets The stream con...">wickr_stream_ctx</a> documentation </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a newly allocated stream context owning the properties passed in </dd></dl>

</div>
</div>
<a id="gaa1eb323694f2c1652b51127b0b89138c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa1eb323694f2c1652b51127b0b89138c">&#9670;&nbsp;</a></span>wickr_stream_ctx_decode()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__buffer.html">wickr_buffer_t</a>* wickr_stream_ctx_decode </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__stream__ctx.html">wickr_stream_ctx_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a> *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>aad</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint64_t&#160;</td>
          <td class="paramname"><em>seq_num</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Encode a packet</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>context to use for decoding </td></tr>
    <tr><td class="paramname">data</td><td>the data to decode using the context's key </td></tr>
    <tr><td class="paramname">aad</td><td>additional data to authenticate with the ciphertext </td></tr>
    <tr><td class="paramname">seq_num</td><td>the sequence number assoiciated with 'data' </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a buffer representing 'data' decrypted with 'ctx-&gt;key' </dd></dl>

</div>
</div>
<a id="ga05260bfce1f50352cad32e0354c28a1d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga05260bfce1f50352cad32e0354c28a1d">&#9670;&nbsp;</a></span>wickr_stream_ctx_destroy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wickr_stream_ctx_destroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__stream__ctx.html">wickr_stream_ctx_t</a> **&#160;</td>
          <td class="paramname"><em>ctx</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Destroy a stream context</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>a pointer to the stream context to destroy. All properties of '*ctx' will also be destroyed </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga621a3ec801ab996b4fab1fe905c450bd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga621a3ec801ab996b4fab1fe905c450bd">&#9670;&nbsp;</a></span>wickr_stream_ctx_encode()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structwickr__cipher__result.html">wickr_cipher_result_t</a>* wickr_stream_ctx_encode </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__stream__ctx.html">wickr_stream_ctx_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structwickr__buffer.html">wickr_buffer_t</a> *&#160;</td>
          <td class="paramname"><em>aad</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint64_t&#160;</td>
          <td class="paramname"><em>seq_num</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Encode a packet</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>context to use for encoding </td></tr>
    <tr><td class="paramname">data</td><td>the data to encode using the context's key </td></tr>
    <tr><td class="paramname">aad</td><td>additional data to authenticate with the ciphertext </td></tr>
    <tr><td class="paramname">seq_num</td><td>the sequence number assoiciated with 'data' </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>a cipher result representing 'data' encrypted with 'ctx-&gt;key' </dd></dl>

</div>
</div>
<a id="ga98121b9f8cdab6596cbd3bb0d99be6e3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga98121b9f8cdab6596cbd3bb0d99be6e3">&#9670;&nbsp;</a></span>wickr_stream_ctx_ref_up()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool wickr_stream_ctx_ref_up </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwickr__stream__ctx.html">wickr_stream_ctx_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Increment the reference count of a stream</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>the context to bump the reference count of </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.15
</small></address>
</body>
</html>
